<?php
include ('top.ajax.php');
$products=Product::getProductsHome();
$tpl->assign('products',$products);

$product=Product::get(utf8_decode($_POST['nom']));
$i=0;
foreach($products as $pdt) {
	if($product['id']==$pdt['id']){
		$i=1;
	}
} 

if($i==0) {
$db=Database::getInstance();
$sql="INSERT INTO produits_home (produit_id,ordre) VALUES ('".$product['id']."','".$_POST['ordre']."')";
$result=$db->query($sql);
}




?>